
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObject;
using DataAccessLayer;

namespace BusinessLogic
{
    /// <summary>
    /// Define CurencyUtil class. This class user for BussinessLayer.

    /// </summary>
    public class CurencyUtil
    {
        /// <summary>
        /// Define function Insert for Curency Object.
        /// </summary>
        /// <param name="t">object data need Insert.</param>
        /// <returns>
        ///    1: if insert successfull.
        ///    0: if insert error.
        ///    -1: Item is exists
        ///</returns>
        public static int Insert(Curency t)
        {
            return CurencyDao.Insert(t);
        }
        /// <summary>
        /// Define function Update for Curency Object.
        /// </summary>
        /// <param name="t">project data need updated.</param>
        /// <returns>
        ///    True: if update successful.
        ///    False: if update Error.
        ///</returns>
        public static bool Update(Curency t)
        {

            return CurencyDao.Update(t);
        }
        /// <summary>
        /// Get All Curency object from table Curency.
        /// </summary>
        /// <returns>List Curency object.</returns>
        public static List<CurencyResult> GetAll()
        {
            return CurencyDao.GetAll();
        }
        /// <summary>
        /// Search Curency object in table Curency.
        /// </summary>
        /// <param name="t">Condition for Search.</param>

        /// <returns>List CurencyResult objects.</returns>

        public static List<CurencyResult> SearchCurencySomeCondition(Curency t)
        {
            return CurencyDao.SearchCurencySomeCondition(t);
        }
        /// <summary>
        /// Get a Curency data object by primary key. 
        /// </summary>
        /// <param name="code" >This is primary key.</param>
        /// <returns>A Curency object.</returns>

        public static Curency Get(string code)
        {
            return CurencyDao.Get(code);
        }
        /// <summary>
        /// This function to Delete Curency object by primary key.
        /// </summary>
        /// <param name="code" >This is primary key.</param>
        /// <returns>If succesful return True else  return False.</returns>

        public static bool Delete(string code)
        {

            return CurencyDao.Delete(code);
        }
        public static bool Publish(Curency obj)
        {
            return CurencyDao.Publish(obj);
        }
        

        public static bool Order(Curency obj, int type)
        {
            return CurencyDao.Order(obj, type);
        }
        public static List<CurencyResult> GetCurencyDTNhapHang()
        {
            return CurencyDao.GetCurencyDTNhapHang();
        }
    }
}